package com.plian.system.controller.sys.per;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.per.BusUserOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "api/busUserOrg")
public class BusUserOrgController extends BaseController {
    @Autowired
    BusUserOrgService busUserOrgService;
    /**
     * 配置用户单位
     */
    @PostMapping(value = "/config")
    public ObjResult userOrgConfig(@RequestBody PageData pd) throws Exception {
        return busUserOrgService.userOrgConfig(pd);
    }
    /**
     * 根据用户id查询有权限的单位
     * @param pd
     * @throws Exception
     * @return
     */
    @PostMapping(value = "/queryUserOrg")
    public ObjResult queryUserOrg(@RequestBody PageData pd) throws Exception {
        return busUserOrgService.UserOrg(pd);
    }
//    @PostMapping(value = "/queryUserOrgList") TODO DEL
//    public ObjResult queryUserOrgList(){
//        return busUserOrgService.queryUserOrgList();
//    }
}
